package com.cskaoyan.controller.wx.hx;

import com.cskaoyan.module.bean.BaseRespVo;
import com.cskaoyan.module.pojo.MarketUser;
import com.cskaoyan.service.wx.hx.VXSearchService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 处理查找业务的controller
 * 创建日期: 2022/04/10 21:40
 *
 * @author Administrator
 */
@RestController
@RequestMapping("wx/search")
public class VXSearchController {

    @Autowired
    VXSearchService vxSearchService;

    @GetMapping("index")
    public BaseRespVo index(){
        BaseRespVo baseRespVo = vxSearchService.searchIndex();
        return baseRespVo;
    }
    @GetMapping("helper")
    public BaseRespVo helper(String keyword){

        BaseRespVo baseRespVo = vxSearchService.searchHelper(keyword);
        return baseRespVo;
    }
    @PostMapping("clearhistory")
    public BaseRespVo clear(){
        vxSearchService.clearhistory();
        return BaseRespVo.ok("成功");
    }
}
